package code.c04_String.homework;

import java.util.Scanner;

/**
 * @author thinkpad - 83start
 * @version v1.0
 * @create 2022/10/21 19:57
 * @package code.c04_String.homework
 * @description 文件说明
 */

public class Test {

        public static void main(String[] args){
            Scanner scanner=new Scanner(System.in);
            while(scanner.hasNext()){

                String s=scanner.next();
                if (s.equals("#")){
                    System.exit(0);
                }
                String t=scanner.next();
                int count=0;
                while(s.contains(t)){
                    s=s.replaceFirst(t,"");
                    count++;
                }
                System.out.println(count);
            }
        }

}
